package com.lanqiao.companymanage.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lanqiao.companymanage.entity.Cost;
import com.lanqiao.companymanage.mapper.CostMessMapper;
import com.lanqiao.companymanage.service.CostMessService;
import org.springframework.stereotype.Service;

/**
 * @author 何小棍
 * 费用信息查看与添加
 */
@Service
public class CostMessServiceImpl extends ServiceImpl<CostMessMapper, Cost> implements CostMessService {
    /**
     * 分页查询
     */
    @Override
    public Page<Cost> listPage(Page<Cost> costPage) {
        return baseMapper.selectPage(costPage,null);
    }

    /**
     * 根据id查询
     * @param id
     * @return
     */
    @Override
    public Cost selectById(Integer id) {
        return baseMapper.selectById(id);
    }

    @Override
    public int addCost(Cost cost) {
        return baseMapper.insert(cost);
    }

    @Override
    public int deleteById(Integer id) {
        return baseMapper.deleteById(id);
    }

    @Override
    public int updateCost(Cost cost) {
        return baseMapper.updateById(cost);
    }
}
